import { defineStore } from 'pinia';
import { parse, stringify } from 'zipson'
import type { Ref } from 'vue';
import { ref } from 'vue';

type State = {
    token: string
}

// @ts-ignore
export const useBiSystemStore = defineStore<'good-good-store', State>('good-good-store', () => {
    const token = ref<string[]>([]);
    return {
        token
    }
}, {
    // @ts-ignore
    persist: {
        storage: localStorage,
        key: 'good-good-store',
        // @ts-ignore
        paths: ['token'],
        serializer: {
            deserialize: parse,
            serialize: stringify,
        },
    }
})
